package day06;

public class MethodPracticeDemo {
    public static void main(String[] args) {
        say();
        sayHi("JK");
        sayHello("爹",1000000);
        double a = getNum();
        System.out.println(a);//8.88
        int num888 = plus(10,10);//num1=10,num2=10
        System.out.println(num888);//num888=num1+num2
        int[] arr = testArray(10,100);
        System.out.println("数组元素:"+arr.length);
        int[] arr1 = testArray(100,1000);
        for(int i = 0;i<arr1.length;i++){
            System.out.println("arr1["+i+"]="+arr1[i]);
        }
        System.out.println("继续执行。。。。。");
    }
    public static int[] testArray(int len,int max){
        int[] arr = new int[len];
        for(int i = 0;i<arr.length;i++){
            arr[i] = (int)(Math.random()*(max+1));
        }
        return arr;
    }
    public static int plus(int num1,int num2){
        int num = num1+num2;
        return num;
    }
    public static double getNum(){
        return 8.88;
    }
    public static void sayHello(String name,int age){
        System.out.println("大家好我叫"+name+",今年"+age+"岁了");
    }
    public static void sayHi(String name){
        System.out.println("大家好我叫"+name+",今年***岁了");
    }
    public static void say(){
        System.out.println("大家好我叫**，今年***岁了");
    }
}
